package asteroids.model.programs.Expression;

/**
* 
* @version 0.3
* @author  Tandan Sunil, Van Deun Luca
*
*/
public abstract class EntityMethodExpression extends MethodExpression {

	public EntityMethodExpression(int line, int column, Expression e) {
		super(line, column);
		if (!canHaveAsExpression(e))
			throw new IllegalArgumentException(
					"Cannot have the given expression as entity expression");
		entityExpression = (IEntityExpression) e;
	}

	public boolean canHaveAsExpression(Expression e) {
		return e instanceof IEntityExpression;
	}

	private IEntityExpression entityExpression;

	public IEntityExpression getEntityExpression() {
		return entityExpression;
	}
}
